<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title>商品评论管理</title>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }

        .tabfont01 {
            font-family: "宋体";
            font-size: 9px;
            color: #555555;
            text-decoration: none;
            text-align: center;
        }

        .font051 {
            font-family: "宋体";
            font-size: 12px;
            color: #333333;
            text-decoration: none;
            line-height: 20px;
        }

        .font201 {
            font-family: "宋体";
            font-size: 12px;
            color: #FF0000;
            text-decoration: none;
        }

        .button {
            font-family: "宋体";
            font-size: 14px;
            height: 37px;
        }

        html {
            overflow-x: auto;
            overflow-y: auto;
            border: 0;
        }

        -->
    </style>

    <link href="../css/css.css" rel="stylesheet" type="text/css"/>
    <script type="text/JavaScript">

    </script>
    <link href="../css/style.css" rel="stylesheet" type="text/css"/>
</head>
<SCRIPT language=JavaScript>
    function sousuo() {
        window.open("gaojisousuo.htm", "", "depended=0,alwaysRaised=1,width=800,height=510,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
    }
    function selectAll() {
        var obj = document.fom.elements;
        for (var i = 0; i < obj.length; i++) {
            if (obj[i].name == "delid") {
                obj[i].checked = true;
            }
        }
    }

    function unselectAll() {
        var obj = document.fom.elements;
        for (var i = 0; i < obj.length; i++) {
            if (obj[i].name == "delid") {
                if (obj[i].checked == true) obj[i].checked = false;
                else obj[i].checked = true;
            }
        }
    }

</SCRIPT>

<body>
<form name="fom" id="fom" method="post" action="">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="30">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="62" background="../images/nav04.gif">

                            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <%--<tr>--%>
                                    <%--<td width="21"><img src="../images/ico07.gif" width="20" height="18"/></td>--%>
                                    <%--<td width="538">查看内容：按时间：--%>
                                        <%--<input name="textfield" type="text" size="12" readonly="readonly"/>--%>
                                        <%--<span class="newfont06">至</span>--%>
                                        <%--<input name="textfield" type="text" size="12" readonly="readonly"/>--%>
                                        <%--<input name="Submit4" type="button" class="right-button02" value="查 询"/></td>--%>
                                    <%--<td width="144" align="left"><a href="#" onclick="sousuo()">--%>
                                        <%--<input name="Submit3" type="button" class="right-button07" value="高级搜索"/>--%>
                                    <%--</a></td>--%>
                                <%--</tr>--%>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table id="subtree1" <%--style="DISPLAY: "--%> width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <%--<tr>--%>
                                    <%--<td height="20"><span class="newfont07">选择：<a href="#" class="right-font08"--%>
                                                                                  <%--onclick="selectAll();">全选</a>-<a--%>
                                            <%--href="#" class="right-font08" onclick="unselectAll();">反选</a></span>--%>
                                        <%--<input type="button" class="right-button08" value="删除所选评论" onclick="dels()"/>--%>
                                        <%--<input name="Submit2" type="button" class="right-button08" value="添加评论"--%>
                                               <%--onclick="window.location='${path}/backstage/comment/addPre?pid=${product.pid}';"/></td>--%>
                                <%--</tr>--%>
                                <tr>
                                    <td style="font-size: 20px;">
                                        商品编号：${product.pNo}&nbsp;&nbsp;&nbsp;&nbsp;
                                        商品名称：${product.pName}&nbsp;&nbsp;&nbsp;&nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td height="40" class="font42">
                                        <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646"
                                               class="newfont03">
                                            <tr class="CTitle">
                                                <td height="22" colspan="18" align="center" style="font-size:16px">
                                                    商品评论信息列表
                                                </td>
                                            </tr>
                                            </tr>
                                            <tr bgcolor="#EEEEEE">
                                                <%--<td align="center" height="30">选择</td>--%>
                                                <td>序号</td>
                                                <td>用户名</td>
                                                <td>评分等级</td>
                                                <td>评论日期</td>
                                                <td>是否已回复</td>
                                                <td>评论内容</td>
                                                <%--<td>操作</td>--%>
                                            </tr>
                                            <!--迭代商品简介begin-->
                                            <c:forEach items="${comments}" var="c" varStatus="no">
                                                <tr bgcolor="#FFFFFF">
                                                    <input type="hidden" value="${i.introId}" name="commentId" id="commentId">
                                                    <input type="hidden" value="${product.pid}" name="pid" id="pid">
                                                    <%--<td height="20"><input type="checkbox" name="delid"--%>
                                                                           <%--value="${c.commentId}"></td>--%>
                                                    <td>${no.count}</td>
                                                    <td>${c.username}</td>
                                                    <td>${c.rank}</td>
                                                    <td>${c.commentDate}</td>
                                                    <td>${c.isReply}</td>
                                                    <td>${c.content}</td>
                                                    <%--<td><a href="${path}/backstage/comment/editPre?commentId=${c.commentId}&pid=${product.pid}">编辑|</a>--%>
                                                        <%--<a href="${path}/backstage/comment/delete?commentId=${c.commentId}&pid=${product.pid}">删除</a>--%>
                                                    <%--</td>--%>
                                                </tr>
                                            </c:forEach>
                                            <!--迭代商品简介end-->
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <%--<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">--%>
                            <%--<tr>--%>
                            <%--<td height="6"><img src="../images/spacer.gif" width="1" height="1"/></td>--%>
                            <%--</tr>--%>
                            <%--</table>--%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</form>

<script type="text/javascript" src="${path}/js/jquery.min.js"></script>

<script>
    //批量删除
    function dels() {
        var cks = $("input[name='delid']");
        var count = 0;
        var commentIds = "?1=1";
        for (var i = 0; i < cks.length; i++) {
            if (cks[i].checked) {
                commentIds += "&commentId=" + cks[i].value;
                count++;
            }
        }
        if (count == 0) {
            alert("请选择需要删除的信息！");
            return;
        }
        window.location = "${path}/backstage/comment/delete" + commentIds+"&pid=${product.pid}";
    }
</script>


</body>
</html>
